package com.sh.data.engine.application.model.request.datadev;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
@Schema
public class OfflineDevTaskFlowNodeSaveRequest {


    @Schema(description = "工作流节点id", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long id;

    @Schema(description = "工作流子任务节点Id")
    private Long subTaskId;

    @NotNull(message = "节点类型不能为空")
    @Schema(description = "子任务节点类型")
    private Integer nodeType;

    @Schema(description = "api type, 0: http, 1: ws")
    private Integer apiType;

    @Schema(description = "x轴坐标")
    private String x;

    @Schema(description = "y轴坐标")
    private String y;

    @NotBlank(message = "任务名称不能为空")
    @Length(min = 2, max = 64, message = "名称长度为2-64个字符")
    @Pattern(regexp = "[a-zA-Z0-9_\\u4e00-\\u9fa5]+", message = "名称支持中文、字母、数字、下划线")
    @Schema(description = "任务名称", requiredMode = Schema.RequiredMode.REQUIRED)
    private String nodeName;

    @Schema(description = "描述")
    @Length(max = 128, message = "描述最多128个字符")
    private String remark;
}
